package org.reborn.model.bound

import org.reborn.math.VectorF

class BoundingSphere(val position:VectorF, val radius:Float) extends Bound {
  
  /**
   * Pre-calculated value of the radius squared.
   */
  lazy val radiusSquared = radius * radius
	
  def containsPoint(point:VectorF):Boolean = {
	val toCenter = position - point
	val distSqrd = toCenter dot toCenter
	distSqrd <= radiusSquared  
  }
}